import Vue from 'vue'
import App from './App'

// #ifdef H5
import wx from './static/utils/jweixin/wechat.js'
Vue.prototype.$wx = wx
// #endif

// 节流方法
import throttle from './api/throttle.js'
Vue.prototype.$throttle = throttle

// 转时间格式
import timeFormat from './static/utils/timeFormat.js'
Vue.prototype.$timeFormat = timeFormat

Vue.config.productionTip = false

App.mpType = 'app'

// ajax请求
import request from './api/request.js'
import url from './api/config.js'
import api from './api/api.js'
Vue.prototype.$request = request
Vue.prototype.$api = api
Vue.prototype.$url = url

// 验证码组件注册
import validCode from './components/validCode.vue'
Vue.component('validcode',validCode)

// tabs组件
import tabs from './components/tabs.vue'
Vue.component('tabs',tabs)

// 页面上拉加载组件
import loading from './components/loading.vue'
Vue.component('loading',loading)

// 上拉没有更多数据组件
import noMore from './components/noMore.vue'
Vue.component('no-more',noMore)

// 弹窗输入框组件
import modal from './components/modal.vue'
Vue.component('modal',modal)

// 没有数据提示
import nothing from './components/nothing-tips.vue'
Vue.component('nothing',nothing)

// 弹窗组件
import uniPopup from '@/components/uni-popup/uni-popup.vue'
Vue.component('uni-popup',uniPopup)

// 弹窗组件
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
Vue.component('uni-popup-dialog',uniPopupDialog)

// 弹窗组件
import uModal from '@/uview-ui/components/u-modal/u-modal.vue'
Vue.component('u-modal',uModal)

// 搜索组件
import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
Vue.component('uni-search-bar',uniSearchBar)

// 地区选择组件
import simpleAddress from '@/components/simple-address/simple-address.vue'
Vue.component('simple-address',simpleAddress)

// 富文本解析插件
import jyfParser from "@/components/jyf-parser/jyf-parser";
Vue.component('jyf-parser',jyfParser)

import '@/static/utils/ican-H5Api'

// 竖轴组件
import axis from "@/components/axis/axis";
Vue.component('axis',axis)

// 日期时间选择插件
import yuDatetimePicker from '@/components/yu-datetime-picker/yu-datetime-picker'
Vue.component('yu-datetime-picker',yuDatetimePicker)

// 竖轴组件
import uTimeLine from "@/components/u-time-line/u-time-line";
Vue.component('u-time-line',uTimeLine)

import uTimeLineItem from "@/components/u-time-line-item/u-time-line-item";
Vue.component('u-time-line-item',uTimeLineItem)

import uSearch from "@/components/u-search/u-search";
Vue.component('u-search',uSearch)

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);

import uSticky from "@/uview-ui/components/u-sticky/u-sticky";
Vue.component('u-sticky',uSticky)

import uParse from "@/uview-ui/components/u-parse/u-parse";
Vue.component('u-parse',uParse)

// 检查是否登录
// Vue.prototype.$checkLogin = function(backpage, backtype){ //backpage返回页面  backtype页面类型
// 	let token  = uni.getStorageSync('token');
// 	if(!token){
// 		uni.redirectTo({url:'../login/login?backpage='+backpage+'&backtype='+backtype});
// 		return false;
// 	}
// 	return [token];
// }

const app = new Vue({
    ...App
})
app.$mount()
